package com.learn.demo.lambda.core4api;

import java.util.function.Consumer;

/**
 * 消费型接口
 *
 * @author banjiawei
 * @date 2021/06/19
 */
public class ConsumerDemo {
    public static void main(String[] args) {
        Consumer<String> consumer = (str) -> System.out.println(str.trim());
        consumer.accept("\t\t\t 测试   ");
        consumer = (str) -> System.out.println(str.substring(2));
        consumer.accept("12345");
    }
}
